home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: HELP!!!! --very important!!--
- Date: 23 Mar 1996 00:27:51 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4j05l7$7gb@solutions.solon.com>
- References: <1996Mar21.000242.138161@forest> <4iv8ub$95t@spanky.pls.ov.com>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4iv8ub$95t@spanky.pls.ov.com>,
- Fletcher.Glenn@ov.com <glenn@ov.com> wrote:
- >In article 138161@forest, groy@forest.drew.edu (I can't think of a nickname) writes:
- >>Please Help....
- >>I need to get this program working... the function set_diff is supposed to
- >>find the differences between the two arrays (a[] and b[]) and put the
- >>differences(if any) in array c[]....
-
- >>int set_diff(int a[], int b[], int c[], int max) {
- >> int *first = a;
- >> int *second = b;
- >> int *third = c;
-
- >The above three pointers are pointers to *copies* of the input arrays.
-
- Huh?
-
- >None of the original arrays are affected in any way. If that was not
- >your intent, then you need to reformulate your input list to be
- >pointers to the arrays, and to adjust your function code accordingly.
-
- This is utterly incorrect. When you declare a function argument as
- an array, it silently converts into a pointer.
-
- You could easily test this, or verify it by reading the standard.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-